import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: Admin
 * Date: 2022-12-02
 * Time: 19:11
 */
public class Demo1 {
    public static void main(String[] args) {

        Scanner scan = new Scanner(System.in);

        while(scan.hasNextInt()) {

            int n = scan.nextInt();
            String[] array = new String[n];
            for(int i = 0; i < n; i++) {
                array[i] = scan.nextLine();
            }

            String str1 = "";
            for(int j = 0; j < array.length; j++) {
                if(array[j].contains(" ")|| array[j].contains(",")) {
                    str1 += "\"" + array[j] + "\"";
                }else {
                    str1+=array[j];
                }

                if(j < array.length - 1) {
                    str1+=", ";
                }
            }

            System.out.println(str1);
        }
    }
}
